<template>
  <div>
    <BasicTable @register="registerTable" :searchInfo="searchInfo">
      <template #action="{ record }">
        <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
      </template>
    </BasicTable>
  </div>
</template>
<script lang="ts" setup name="orderReward">
import { ActionItem, BasicTable, TableAction } from '@apps/antd-admin/src/components/table';
import { useBaseTable } from '@apps/antd-admin/src/hooks';
import { columns, searchFormSchema } from './data/data';
import { Api } from './data/api';
import { reactive } from 'vue';

const { prefixCls, tableContext, handleDelete, handleSuccess, handlePost, handleBatchDelete } = useBaseTable({
  designScope: 'orderReward-template',
  tableProps: {
    //表格标题
    title: '打赏订单列表',
    //主键字段
    rowKey: 'orderRewardId',
    //列表接口
    listUrl: Api.page,
    handlerName: 'busOrderRewardListHandler',
    //删除接口
    delUrl: Api.remove,
    //列定义
    columns,
    //查询表单配置
    formConfig: {
      labelWidth: 120,
      schemas: searchFormSchema,
    },
    showActionColumn: false,
  },
});

const [registerTable, { reload }, { rowSelection, hasSelectedRows }] = tableContext;

/**
 * 行内操作栏
 */
function getTableAction(record): ActionItem[] {
  return [];
}

/**
 * 下拉操作栏
 */
function getDropDownAction(record): ActionItem[] {
  return [];
}

const searchInfo = reactive<Recordable>({});

function setSearchInfoProps(butlerServiceOrderId) {
  searchInfo.butlerServiceOrderId = butlerServiceOrderId;
}
defineExpose({
  setSearchInfoProps,
});
</script>
